package com.cty.mapper;

import com.cty.pojo.Menu;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Auther: cty
 * @Date: 2020/3/29 19:55
 * @Description:
 * @version: 1.0
 */
public interface MenuMapper {
    // 查询全部菜单
    @Select("select * from menu")
    List<Menu> selAll();

    // 按pid查询
    @Select("select * from menu where pid=#{pid}")
    List<Menu> selByPid(int pid);

    // 按id查询
    @Select("select * from menu where id=#{id}")
    Menu selById(int id);

    // 修改项目名称和父项目
    @Update("update menu set name=#{name}, pid=#{pid} where id=#{id}")
    int updMenu(Menu menu);
}
